<?php
// +----------------------------------------------------------------------
// | Workman and Gateway-worker
// +----------------------------------------------------------------------
// | Copyright (c) 2015-2025 http://www.yicmf.com, All rights reserved.
// +----------------------------------------------------------------------
// | Author: 微尘 <yicmf@qq.com>
// +----------------------------------------------------------------------

namespace yicmf\worker\handler;


use think\facade\Log;
use yicmf\worker\Plan as ServerPlan;

class Plan extends ServerPlan
{
    /**
     * 每秒执行，多进程存在并发
     */
    public static function run($id = null)
    {
        Log::channel(self::$log_channel)->write('run');
    }

    /**
     * 每分2钟执行
     * @return void
     */
    public static function min_2()
    {

        Log::channel('task')->record('rum2n_' . time());
    }

    /**
     * 每分3秒执行
     * @return void
     */
    public static function sec_3()
    {

        Log::channel('task')->record('ru3n_' . time());
    }

    /**
     * 每周1执行，间隔5秒一次
     * @return void
     */
    public static function week_1_5()
    {

        Log::channel('task')->record('week_1_5' . time());
    }
  /**
     * 每月1号执行，间隔5秒一次
     * @return void
     */
    public static function month_1_5()
    {

        Log::channel('task')->record('week_1_5' . time());
    }

    /**
     * onClose 事件回调
     * @return void
     */
    public static function onClose()
    {

    }
}